package model;

// A general Agent
public class Agent {
	
	//Universe of the agent
	Space2D universe;

	//Position of the agent
	Point location;
	
	//Name
	String name = "";
	
	public Agent(Space2D universe_, Point location) throws Exception{
		universe = universe_;
		int dimX = universe.getDimX();
		int dimY = universe.getDimY();
		if ((location.getX()<0)||(location.getX()>=dimX)||(location.getY()<0)||(location.getY()>=dimY)){
			throw new Exception("The agent would be out of the universe");
		} else {
			this.location = location;
		}
	}

	public Point getLocation() {
		return location;
	}
	
	public void setLocation(Point location) {
		this.location = location;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String toString(){
		return this.name;
	}
	
}
